.class public Lrexsee/dialog/ButtonDialog;
.super Lrexsee/core/widget/DivDialog;
.source "ButtonDialog.java"


# direct methods
.method public constructor <init>(Lrexsee/core/browser/Browser;Ljava/lang/String;Ljava/lang/String;[Lrexsee/core/menu/PopMenu;)V
    .locals 6
    .param p1, "browser"    # Lrexsee/core/browser/Browser;
    .param p2, "dialogId"    # Ljava/lang/String;
    .param p3, "style"    # Ljava/lang/String;
    .param p4, "menus"    # [Lrexsee/core/menu/PopMenu;

    .prologue
    .line 15
    invoke-direct {p0, p1, p2, p3}, Lrexsee/core/widget/DivDialog;-><init>(Lrexsee/core/browser/Browser;Ljava/lang/String;Ljava/lang/String;)V

    .line 17
    :try_start_0
    new-instance v2, Landroid/widget/LinearLayout;

    invoke-virtual {p1}, Lrexsee/core/browser/Browser;->getContext()Landroid/content/Context;

    move-result-object v3

    invoke-direct {v2, v3}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;)V

    .line 18
    .local v2, "layout":Landroid/widget/LinearLayout;
    const/4 v3, 0x1

    invoke-virtual {v2, v3}, Landroid/widget/LinearLayout;->setOrientation(I)V

    .line 19
    iget-object v3, p0, Lrexsee/dialog/ButtonDialog;->styleSheet:Lrexsee/core/style/StyleSheet;

    invoke-virtual {v3}, Lrexsee/core/style/StyleSheet;->getGravity()I

    move-result v3

    invoke-virtual {v2, v3}, Landroid/widget/LinearLayout;->setGravity(I)V

    .line 20
    const/4 v3, 0x0

    invoke-virtual {v2, v3}, Landroid/widget/LinearLayout;->setBackgroundColor(I)V

    .line 21
    const/4 v1, 0x0

    .local v1, "i":I
    :goto_0
    array-length v3, p4

    if-lt v1, v3, :cond_0

    .line 24
    invoke-virtual {p0, v2}, Lrexsee/dialog/ButtonDialog;->addChild(Landroid/view/View;)V

    .line 28
    .end local v1    # "i":I
    .end local v2    # "layout":Landroid/widget/LinearLayout;
    :goto_1
    return-void

    .line 22
    .restart local v1    # "i":I
    .restart local v2    # "layout":Landroid/widget/LinearLayout;
    :cond_0
    aget-object v3, p4, v1

    if-eqz v3, :cond_1

    new-instance v3, Lrexsee/core/widget/TabButtonRow;

    invoke-virtual {p1}, Lrexsee/core/browser/Browser;->getContext()Landroid/content/Context;

    move-result-object v4

    aget-object v5, p4, v1

    invoke-direct {v3, v4, v5}, Lrexsee/core/widget/TabButtonRow;-><init>(Landroid/content/Context;Lrexsee/core/menu/PopMenu;)V

    invoke-virtual {v2, v3}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 21
    :cond_1
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 25
    .end local v1    # "i":I
    .end local v2    # "layout":Landroid/widget/LinearLayout;
    :catch_0
    move-exception v3

    move-object v0, v3

    .line 26
    .local v0, "e":Ljava/lang/Exception;
    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {p1, v3, v0}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_1
.end method


# virtual methods
.method public onKeyDown(ILandroid/view/KeyEvent;)Z
    .locals 2
    .param p1, "keyCode"    # I
    .param p2, "event"    # Landroid/view/KeyEvent;

    .prologue
    const/4 v1, 0x1

    .line 32
    const/4 v0, 0x4

    if-ne p1, v0, :cond_2

    .line 33
    iget-object v0, p0, Lrexsee/dialog/ButtonDialog;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v0, v0, Lrexsee/core/browser/Browser;->menu:Lrexsee/core/menu/RexseeMenu;

    iget-boolean v0, v0, Lrexsee/core/menu/RexseeMenu;->isOptionsMenuOpen:Z

    if-eqz v0, :cond_0

    .line 34
    iget-object p0, p0, Lrexsee/dialog/ButtonDialog;->mContext:Landroid/content/Context;

    .end local p0    # "this":Lrexsee/dialog/ButtonDialog;
    check-cast p0, Landroid/app/Activity;

    invoke-virtual {p0}, Landroid/app/Activity;->closeOptionsMenu()V

    move v0, v1

    .line 48
    :goto_0
    return v0

    .line 37
    .restart local p0    # "this":Lrexsee/dialog/ButtonDialog;
    :cond_0
    iget-object v0, p0, Lrexsee/dialog/ButtonDialog;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v0, v0, Lrexsee/core/style/StyleSheet;->window_cancelable:Ljava/lang/String;

    const-string v1, "true"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_1

    invoke-virtual {p0}, Lrexsee/dialog/ButtonDialog;->dismiss()V

    .line 48
    .end local p0    # "this":Lrexsee/dialog/ButtonDialog;
    :cond_1
    :goto_1
    const/4 v0, 0x0

    goto :goto_0

    .line 39
    .restart local p0    # "this":Lrexsee/dialog/ButtonDialog;
    :cond_2
    const/16 v0, 0x52

    if-ne p1, v0, :cond_3

    .line 40
    iget-object p0, p0, Lrexsee/dialog/ButtonDialog;->mContext:Landroid/content/Context;

    .end local p0    # "this":Lrexsee/dialog/ButtonDialog;
    check-cast p0, Landroid/app/Activity;

    invoke-virtual {p0}, Landroid/app/Activity;->openOptionsMenu()V

    goto :goto_1

    .line 41
    .restart local p0    # "this":Lrexsee/dialog/ButtonDialog;
    :cond_3
    const/16 v0, 0x54

    if-ne p1, v0, :cond_4

    move v0, v1

    .line 42
    goto :goto_0

    .line 43
    :cond_4
    const/16 v0, 0x50

    if-eq p1, v0, :cond_1

    .line 44
    const/16 v0, 0x18

    if-eq p1, v0, :cond_1

    goto :goto_1
.end method
